package com.tp.ssm.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
public class LoginController{
	
	//登录
	@RequestMapping("/login")
	public String login(String username,String password,HttpSession session) throws Exception {
		session.setAttribute("username", username);
		
		return "redirect:/items/queryItems.action" ;
	}
	
	//退出
	@RequestMapping("/logout")
	public String logout(HttpSession session) throws Exception{
		session.invalidate(); 
		
		return "redirect:/items/queryItems.action" ;
	}
}
